package top.jacktgq.lock.reentrantLock;

import java.util.concurrent.locks.LockSupport;

import top.jacktgq.utils.LogUtils;

/**
 * 
 * @Title: TestReentrantLock.java 
 * @Package top.jacktgq.lock 
 * @Description: 多线程之固定运行：使用await和signal
 * @author CandyWall   
 * @date 2020年11月1日 下午5:49:07 
 * @version V1.0
 */
public class Demo5_3_park_unpark {
	public static void main(String[] args) {
		Thread t1 = new Thread(() -> {
			LockSupport.park();
			LogUtils.log("Demo5_3_park_unpark", "线程执行了...");
		}, "t1");
		Thread t2 = new Thread(() -> {
			LogUtils.log("Demo5_1_wait_notify", "线程执行了...");
			LockSupport.unpark(t1);
		}, "t2");
		t1.start();
		t2.start();
	}	
}
